<?php
// $Id: signform.inc.php, v 2.11 2004/12/02 C. Felix alias the Cat
//  ------------------------------------------------------------------------ //
//             XF Guestbook                                                  //
// ------------------------------------------------------------------------- //
//  This program is free software; you can redistribute it and/or modify     //
//  it under the terms of the GNU General Public License as published by     //
//  the Free Software Foundation; either version 2 of the License, or        //
//  (at your option) any later version.                                      //
//                                                                           //
//  You may not change or alter any portion of this comment or credits       //
//  of supporting developers from this source code or any supporting         //
//  source code which is considered copyrighted (c) material of the          //
//  original comment or credit authors.                                      //
//                                                                           //
//  This program is distributed in the hope that it will be useful,          //
//  but WITHOUT ANY WARRANTY; without even the implied warranty of           //
//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the            //
//  GNU General Public License for more details.                             //
//                                                                           //
//  You should have received a copy of the GNU General Public License        //
//  along with this program; if not, write to the Free Software              //
//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA //
//  ------------------------------------------------------------------------ //

include_once XOOPS_ROOT_PATH."/class/xoopsformloader.php";
include_once XOOPS_ROOT_PATH."/modules/".$xoopsModule->dirname()."/class/formdhtmltextareamod.php";
include_once XOOPS_ROOT_PATH."/modules/".$xoopsModule->dirname()."/class/formselectcountrymod.php";

$opt_icon = $option['opt_icon'];
$opt_font = $option['opt_font'];
$opt_sm = $option['opt_sm'];

$sign_form = new XoopsThemeForm(_MD_XFGB_SIGN, "signform", "sign.php");

$name_text = new XoopsFormText(_MD_XFGB_NAME, "name", 50, 100, $name);
if ($xoopsUser) $name_text->setExtra("readonly = 'readonly'") ;
$sign_form->addElement($name_text, true);

if ($option['opt_gender']) {
//	$gender_text = new XoopsFormRadio(_MD_XFGB_SEXE, "gender", $gender);
	$gender_text = new XoopsFormSelect(_MD_XFGB_SEXE, "gender", $gender);
	$options = array('M' =>_MD_XFGB_MALE, 'F' => _MD_XFGB_FEMALE );
	$gender_text->addOptionArray($options);
	$sign_form->addElement($gender_text, true);
}

// affichage pays
if (trim($option['opt_country']) != '') {
	$country_text = new XoopsFormSelectCountryS(_MD_XFGB_COUNTRY, "country", $country);
	$sign_form->addElement($country_text, false);
}

$email_text = new XoopsFormText(_MD_XFGB_EMAIL, "email", 50, 100, $email);
$sign_form->addElement($email_text, false);

$url_text = new XoopsFormText(_MD_XFGB_URL, "url", 50, 100, $url);
$sign_form->addElement($url_text);

$title_text = new XoopsFormText(_MD_XFGB_TITLE, "title", 50, 100, $title);
$sign_form->addElement($title_text, true);

if ($opt_icon == 0 && $opt_font == 0 && $opt_sm == 0) {
	$sign_form->addElement(new XoopsFormTextArea(_MD_XFGB_MESSAGE, 'message', $message, 6, 40), true);
} else {
	$sign_form->addElement(new XoopsFormDhtmlTextAreaS(_MD_XFGB_MESSAGE, 'message', $message, 6, 40, $opt_icon, $opt_font, $opt_sm ), true);
}

$button_tray = new XoopsFormElementTray('' ,'');
$button_tray->addElement(new XoopsFormButton('', 'preview', _PREVIEW, 'submit'));
$button_tray->addElement(new XoopsFormButton('', 'post', _SEND, 'submit'));
$sign_form->addElement($button_tray);

$sign_form->display();
?>